#include<vector>
using namespace std;
#include<iostream>
#include <bitset>
template<size_t N>
class bit_set
{

	public:

		void set(size_t x)
		{
			//00  ->01
			if (s1.test(x) == false && s2.test(x) == false)
			{
				s2.set(x);
			}

			//01  -> 10
			else if (s1.test(x) == false && s2.test(x) == true)
			{
				s1.set(x);
				s2.reset(x);
			}
		}
		void printonce()
		{
			for (size_t i = 0; i < N; i++)
			{
				if (s1.test(i) == false && s2.test(i) == true)
				{
					cout << i << endl;
				}
			}
		}

	private:
		std::bitset<N> s1;
		std::bitset<N> s2;

};


